package com.aj.activity.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;

import com.aj.activity.R;

public abstract class BaseFragment extends Fragment {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = LayoutInflater.from(getContext()).inflate(
				R.layout.activity_base, null);

		LinearLayout body = (LinearLayout) view.findViewById(R.id.body);
		View contentView = setContentView();
		if (contentView != null) {
			body.addView(contentView, new LinearLayout.LayoutParams(
					LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
		}
		return view;
	}

	protected abstract View setContentView();
}
